package _021_10_5

func FirstNotRepeatingChar(str string) int {
	// write code here
	arr := make([]byte, 300)
	for i := 0; i < 300; i++ {
		arr[i] = 0
	}

	for i := 0; i < len(str); i++ {
		arr[str[i]] += 1
	}
	for i := 0; i < len(str); i++ {
		if arr[str[i]] == 1 {
			return i
		}
	}

	return -1
}
